package com.devg.file.client;

import com.devg.file.client.core.WebServiceRequest;
import com.devg.file.client.core.entity.FileClientConfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(FileClientConfig.class)
@ComponentScan(basePackages = {"com.devg.file.client"})
@ConditionalOnWebApplication //web应用才生效
public class FileClientAutoConfiguration {

  private final FileClientConfig fileClientConfig;

  public FileClientAutoConfiguration(FileClientConfig fileClientConfig) {
    this.fileClientConfig = fileClientConfig;
    WebServiceRequest.fileClientConfig = fileClientConfig;
  }

}
